$(function () {
    var meetSel = $.Params.create();
    meetSel.ajax("get", getMeetIP() + "build", function (data) {
        html = "<option value='0'>请选择会议厅</option>";
        if(data.count > 0){
            $.each(data.rows,function(i,val){
                html+="<option value = '"+val.id+"'>"+val.buildTitle+"</option>";
            })
        }
       $("#buildTitle").html(html);
    })

    $("#addData").on("click", function () {
        var buildId = $("#buildTitle").val();
        var subjectTitle = $("#subjectTitle").val();
        var startTime = $("#startTime").val();
        var endTime = $("#endTime").val();
        var meetTime = $("#meetTime").val();
        var meetDate = $("#meetDate").val();
        var dbUrl = $("#dbUrl").val();
        var addSel = $.Params.create();
        addSel.addParams("buildId", buildId);
        addSel.addParams("subjectTitle", subjectTitle);
        addSel.addParams("startTime", startTime);
        addSel.addParams("endTime", endTime);
        addSel.addParams("meetTime", meetTime);
        addSel.addParams("meetDate", meetDate);
        addSel.addParams("dbUrl", dbUrl);
        addSel.ajax("post", getMeetIP() + "meetSubject", function (data) {
               window.location.href = "meetSubjectList.html";
        })
    })

    $("#cancelAdd").on("click", function () {
        history.go(-1);
    })
})